import https from '../libs/mehaotian-request/interface.js'
import config from '../config/index.js'
/**
 * 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 * handle [boolean] 如果需要自己处理 catch 请求 ，传入 true ，交给接口统一处理 ，请传如 false或不传
 */

/**
 * 查询购物车
 */
export const cartGet = (data) => {
	return https ({
		url: '/api/uc/mobile/cartService/get',
		data: data,
		method: 'get'
	})
}

/**
 * 添加购物车
 */
export const cartAdd = (data) => {
	return https ({
		url: '/api/uc/mobile/cartService/add',
		data: data,
		method: 'post'
	})
}

/**
 * 删除商品
 */
export const cartDelete = (data) => {
	return https ({
		url: '/api/uc/mobile/cartService/delete',
		data: data,
		method: 'post'
	})
}

/**
 * 删除多条商品
 */
export const deleteBatch = (data) => {
	return https ({
		url: '/api/uc/mobile/cartService/deleteBatch',
		data: data,
		method: 'post'
	})
}

/**
 * 清空购物车
 */
export const cartClear = (data) => {
	return https ({
		url: '/api/uc/mobile/cartService/clear',
		data: data,
		method: 'post'
	})
}

/*
*
* app
*
* app
* 
*
* app
*
* app
* 
* app
* 
* app
* 
* */
/**
 * 查询购物车
 */
export const cartGetApp = (data) => {
	return https ({
		url: '/api/uc/mobile/cartAppService/get',
		data: data,
		method: 'get'
	})
}

/**
 * 添加购物车
 */
export const cartAddApp = (data) => {
	return https ({
		url: '/api/uc/mobile/cartAppService/add',
		data: data,
		method: 'post'
	})
}

/**
 * 删除商品
 */
export const cartDeleteApp = (data) => {
	return https ({
		url: '/api/uc/mobile/cartAppService/delete',
		data: data,
		method: 'post'
	})
}

/**
 * 删除多条商品
 */
export const deleteBatchApp = (data) => {
	return https ({
		url: '/api/uc/mobile/cartAppService/deleteBatch',
		data: data,
		method: 'post'
	})
}

/**
 * 清空购物车
 */
export const cartClearApp = (data) => {
	return https ({
		url: '/api/uc/mobile/cartAppService/clear',
		data: data,
		method: 'post'
	})
}


